package com.woniuxy.movice.exception;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;


@ControllerAdvice
public class MyExceptionHandler {


    //拦截未登录登录异常
    @ExceptionHandler(value = AuthException.class)
    public ModelAndView handlerAuthorizeException(AuthException e) {
    	ModelAndView modelAndView =new ModelAndView("redirect:/error");
    	modelAndView.addObject("info", e.getMessage());
        return modelAndView;
    }
}
